Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index strategies with custom yields #30

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from
Draft

Conversation

Evert0x
Copy link
Contributor

@Evert0x Evert0x commented Jun 1, 2022

No description provided.

@rcstanciu rcstanciu force-pushed the feat/strategy-apy branch from 5c382d4 to ab6034d Compare June 6, 2022 12:10
@rcstanciu rcstanciu marked this pull request as ready for review June 15, 2022 15:35
@rcstanciu
Copy link
Member

  • Abstracted strategies in Strategy class instances that hold an address and a name
  • Index each strategy balance
  • Created an API at /strategies that returns the latest indexed strategy balances
  • Created a CustomYield class for each strategy that does not increase its balance each block
  • Computed the weighted APY for all CustomYield strategies and saved it as additional_apy in IndexerState
  • The APY returned in the API now includes the additional_apy so that the expected APY shown in the frontend combines all deployed strategies
  • Use Sentry for error logging
  • Manually log in Sentry whenever an aberration is found in the APY computation (negative APY, APY > 15% or APY that doubled since the last computation)

The PR only requires correct strategy addresses to be inserted in strategies/strategies.py file. However, the PR can be merged with either zero addresses or some random addresses, since the code will skip the computation if the address is not a Strategy contract or not a contract at all.

@rcstanciu rcstanciu changed the title Feat/strategy apy Index strategies Jun 15, 2022
@rcstanciu rcstanciu marked this pull request as draft July 7, 2022 08:51
@rcstanciu rcstanciu changed the title Index strategies Index strategies with custom yields Jul 7, 2022
@Evert0x Evert0x mentioned this pull request Aug 24, 2022
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants